\documentclass{standalone}

\usepackage{pgfplots}
\pgfplotsset{compat=1.14, samples=5}

\begin{document}

\begin{tikzpicture}
\begin{axis}[%
    xmin=-2, xmax=2,
    ymin=-2, ymax=2,
    xtick={\pgfkeysvalueof{/pgfplots/xmin},...,\pgfkeysvalueof{/pgfplots/xmax}},
    ytick={\pgfkeysvalueof{/pgfplots/ymin},\pgfkeysvalueof{/pgfplots/ymin}+1,...,\pgfkeysvalueof{/pgfplots/ymax}},
    ]
\addplot[domain=-2:2, smooth, blue, thick]{x^2};
\end{axis}
\end{tikzpicture}
\end{document} 
